﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XXN.Model;
using XXN.Model.Model;

namespace XXN.Service
{
    public class UserServer
    {
        private Shopping_MallEntities db = new Shopping_MallEntities();

        public UserUI GetUser(string Name)
        {
            var user = from item in db.Users.Where(x => x.User_name == Name)
                       select new UserUI
                       {
                           User_id = item.User_id,
                           User_name = item.User_name,
                           Password = item.Password,
                           Email = item.Email,
                           Phone = item.Phone,

                           User_type = item.User_type,

                           CreateTime = item.CreateTime,
                           UpdateTime = item.UpdateTime,
                       };
            return user.SingleOrDefault();
        }
    }
}